/*
Copyright (C) 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/**
 * @fileoverview Constants used for timezone gadget.
 *     The code used in this file is IE specific.
 */

/**
 * The maximum allowed clocks in this gadget.
 * @type Number
 */
var MAX_CLOCKS = 15;

/**
 * The number of minutes in 12 hours.
 * @type Number
 */
var HALF_A_DAY = 720;

/**
 * A version number to store in the options for checking backward compatibility.
 * @type Number
 */
var VERSION = 1000000;

/**
 * Constant object for holding clock related constants.
 * @type Object
 */
var CLOCK_INF = {
    HORIZONTAL_MARGIN: 2,
    VERTICAL_MARGIN: 2,
    ORIGINAL_WIDTH: 125,
    ORIGINAL_HEIGHT: 150,

    BACKGROUND_NAMES: [BACKG1, BACKG2, BACKG3, BACKG4, BACKG5, BACKG6,
    BACKG7, BACKG8],

    DESIGNS: [
        {NAME: DESIGN1,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 22, HOUR_W: 5, HOUR_H: 24,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 40, MINUTE_W: 5, MINUTE_H: 42,
        SECOND_PIN_X: 1, SECOND_PIN_Y: 40, SECOND_W: 3, SECOND_H: 54,
        CENTER_X: 59, CENTER_Y: 59, CENTER_W: 7, CENTER_H: 7,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN2,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 28, HOUR_W: 5, HOUR_H: 37,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 38, MINUTE_W: 5, MINUTE_H: 47,
        SECOND_PIN_X: 1, SECOND_PIN_Y: 38, SECOND_W: 3, SECOND_H: 47,
        CENTER_X: 58, CENTER_Y: 58, CENTER_W: 9, CENTER_H: 9,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN3,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 28, HOUR_W: 5, HOUR_H: 37,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 38, MINUTE_W: 5, MINUTE_H: 47,
        SECOND_PIN_X: 1, SECOND_PIN_Y: 38, SECOND_W: 3, SECOND_H: 47,
        CENTER_X: 58, CENTER_Y: 58, CENTER_W: 9, CENTER_H: 9,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN4,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 28, HOUR_W: 5, HOUR_H: 37,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 38, MINUTE_W: 5, MINUTE_H: 47,
        SECOND_PIN_X: 1, SECOND_PIN_Y: 38, SECOND_W: 3, SECOND_H: 47,
        CENTER_X: 58, CENTER_Y: 58, CENTER_W: 9, CENTER_H: 9,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN5,
        HOUR_PIN_X: 7, HOUR_PIN_Y: 46, HOUR_W: 15, HOUR_H: 48,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 46, MINUTE_W: 5, MINUTE_H: 48,
        SECOND_PIN_X: null, SECOND_PIN_Y: null, SECOND_W: null, SECOND_H: null,
        CENTER_X: 56, CENTER_Y: 56, CENTER_W: 13, CENTER_H: 13,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN6,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 31, HOUR_W: 5, HOUR_H: 33,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 46, MINUTE_W: 5, MINUTE_H: 48,
        SECOND_PIN_X: null, SECOND_PIN_Y: null, SECOND_W: null, SECOND_H: null,
        CENTER_X: 56, CENTER_Y: 56, CENTER_W: 13, CENTER_H: 13,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN7,
        HOUR_PIN_X: 3, HOUR_PIN_Y: 23, HOUR_W: 7, HOUR_H: 30,
        MINUTE_PIN_X: 3, MINUTE_PIN_Y: 31, MINUTE_W: 7, MINUTE_H: 38,
        SECOND_PIN_X: 2, SECOND_PIN_Y: 38, SECOND_W: 5, SECOND_H: 57,
        CENTER_X: 58, CENTER_Y: 58, CENTER_W: 9, CENTER_H: 9,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62},

        {NAME: DESIGN8,
        HOUR_PIN_X: 2, HOUR_PIN_Y: 21, HOUR_W: 5, HOUR_H: 23,
        MINUTE_PIN_X: 2, MINUTE_PIN_Y: 32, MINUTE_W: 5, MINUTE_H: 34,
        SECOND_PIN_X: 9, SECOND_PIN_Y: 59, SECOND_W: 20, SECOND_H: 61,
        CENTER_X: 58, CENTER_Y: 58, CENTER_W: 9, CENTER_H: 9,
        FACE_CENTER_X: 62, FACE_CENTER_Y: 62}]};

/**
 * Constant object for holding all options names.
 * The value of the name itself makes no difference, but they should be unique
 * amongst themselves.
 * @type Object
 */
var OPTION_NAMES = {
    EDIT_CLOCK_NUM: 'Edit_Clock_Num',
    EDIT_CLOCK_OFFSET: 'Edit_Clock_Offset',
    EDIT_CLOCK_LOCATION: 'Edit_Clock_Location',
    DESIGN: 'Design',
    BACKGROUND: 'Background',
    OPTIONS_DIALOG_TYPE: 'Options_Dialog_Type',
    NUMBERED_PREFIX: 'Clock',
    NUMBERED_OFFSET: '_Offset',
    NUMBERED_DESIGN: '_Design',
    NUMBERED_BACKGROUND: '_Background',
    NUMBERED_LOCATION: '_Location',
    TOTAL_CLOCKS: 'Total_Clocks',
    CLOCK_ARRANGEMENT: 'Clock_Arrangement',
    SHOW_SECONDS: 'Show_Seconds',
    SHOW_TOOLTIP: 'Show_Tooltip',
    SHRINK_IF_IDLE: 'Shrink_If_Idle',
    SHRINK_TIME: 'Shrink_Time',
    SHRINK_PERCENT: 'Shrink_Percent',
    NEW_LOCATION: 'New_Location',
    NEW_OFFSET: 'New_Offset',
    VERSION_NUM: 'Version_Number'};
